import {
  request
} from './request'

function getMovie(v, num, city) {
  return request.get(`/gateway?cityId=${city}&pageNum=${num}&pageSize=10&type=${v}&k=3331291`, {
      data: {
        'X-Host': "mall.film-ticket.film.list"
      }
    }

  )
}

function getswiper() {
  return request.get(`/gateway?type=2&cityId=310100&k=7159689`, {
    data: {
      'X-Host': 'mall.cfg.common-banner'
    }
  })
}

function getdetials(id) {
  return request.get(`/gateway?filmId=${id}&k=5379061`, {
      data: {
        'X-Host': 'mall.film-ticket.film.info'
      }
    }

  )
}

function getcity() {
  return request.get(`/gateway?k=4030732`, {
    data: {
      'X-Host': 'mall.film-ticket.city.list'
    }
  })
}

function getway(id) { //根据城市获取电影院
  return request.get(`/gateway?cityId=${id}&ticketFlag=1&k=9536602`, {
    data: {
      'X-Host': 'mall.film-ticket.cinema.list'
    }
  })
}

function getcinemafilmes(id) { //根据电影院id获取电影
  return request.get(`gateway/?cinemaId=${id}&k=2204914`, {
    data: {
      'X-Host': 'mall.film-ticket.film.cinema-show-film'
    }
  })
}

function getcinemaname(id) { //根据电影院id获取电影院信息
  return request.get(`/gateway/?cinemaId=${id}&k=8527051`, {
    data: {
      'X-Host': 'mall.film-ticket.cinema.info'
    }
  })
}

function getfilmedetial(id, filmid, datanow) { //根据电影院id获取电影详情
  return request.get(`/gateway/?filmId=${filmid}&cinemaId=${id}&date=${datanow}&k=1840164`, {
    data: {
      'X-Host': 'mall.film-ticket.schedule.list'
    }
  })
}

function getnews() {
  return request.get(`/gateway?actId=ElzMZU125260`, {
    data: {
      'X-Host': 'mall.act.static-page.info'
    }
  })
}

function phone(phone) {
  return request.post(`/gateway`, {
    'type': '1',
    'mobile': phone,
    'imgKey': '',
    'imgCode': ''
  }, {
    data: {
      'X-Host': 'mall.user.sms-code.send'
    }
  })
}

function smsCode(phone,smsCode) {
  return request.post(`/gateway`, {
    'mobile': phone,
    'imgKey': '',
    'imgCode': '',
    'smsCode':smsCode,
    'extra':{}
  }, {
    data: {
      'X-Host': 'mall.user.sms-code-login'
    }
  })
}

function hightw(id){   //买票
  return request.get(`gateway/?scheduleId=${id}&k=1988988`,{
    data:{
      'X-Host': 'mall.film-ticket.schedule.info'
    }
  })
}
function tickets(id){
  return request.get(`gateway/?scheduleId=${id}&k=3347670`,{
    data:{
      'X-Host': 'mall.film-ticket.seat.list'
    }
  })
}

function orderbyfilm(id){ //根据电影id获取所有电影信息
  return request.get(`gateway?filmId=${id}&k=8562255`,{
    data:{
      'X-Host': 'mall.film-ticket.film.info'
    }
  })
}
function orderbytime(cityid,filmid){
  return request.get(`gateway/?filmId=${filmid}&cityId=${cityid}&k=2995855`,{
    data:{
      'X-Host': 'mall.film-ticket.cinema.film-show-cinema'
    }
  })
}
export {
  getMovie,
  getswiper,
  getdetials,
  getcity,
  getway,
  getcinemafilmes,
  getcinemaname,
  getfilmedetial,
  getnews,
  phone,
  smsCode,
  hightw,
  tickets,
  orderbyfilm,
  orderbytime
}